<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>javascript 阶段</title>
    <style>
        ul {
            padding: 0;
            margin: 0;
            list-style: none;
        }

        ul li {
            width: 450px;
            height: 90px;
            font-size: 0;
        }

        li span {
            display: inline-block;
            width: 88px;
            height: 88px;
            /* font-size: 15px; */
            border: 1px solid #fff;
            background-image: url(./images/zuowei.png);
            background-repeat: no-repeat;
        }

        .icon-1 {
            background-position: 0 0;
        }

        .icon-2 {
            background-position: 0 -90px;
        }

        .icon-3 {
            background-position: 0 -180px;
        }


    </style>
</head>

<body>
    <!-- <ul>
        <li>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
        </li>
        <li>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
        </li>
        <li>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
        </li>
        <li>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
        </li>
    </ul> -->

    <script>
                var data = [
            [1, 1, 1, 1, 1],
            [1, 3, 3, 3, 1],
            [1, 3, 3, 3, 1],
            [1, 1, 2, 2, 1]
        ]
        var str = "<ul>";
            for(var i = 0 ; i < data.length ; i ++){
                str +="<li>";
                    for(j = 0 ; j < data[i].length ; j ++) {
                        str +="<span class='icon-" + data[i][j] +"'></span>";
                    }
                str +="</li>";
            }
        str += "</ul>";

        document.write(str);
    </script>
</body>
</html>